<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/freedom.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/freedom.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">


  <link rel="manifest" href="/images/manifest.json">


  <meta name="msapplication-config" content="/images/browserconfig.xml">



  <meta name="keywords" content="Spring官方文档学习-基于5.1,">










<meta name="description" content="Spring框架概览​    Spring让创建Java企业级应用变得更简单.它提供了任何你在企业级环境中使用Java进行开发所需要的东西。同时也支持其他能在JVM上运行的语言，例如Groovy和Kotlin。通知也可很灵活创建任何需求所需要的架构。对于Spring框架5.1来说，SPring需要JDK8及其以上的支持，同时也提供对JDK11的开箱即用的长期支持。 ​    Spring支持很多种">
<meta name="keywords" content="Spring官方文档学习-基于5.1">
<meta property="og:type" content="article">
<meta property="og:title" content="Spring框架概览">
<meta property="og:url" content="http://xuren.tech/2019/07/18/Spring框架概览/index.html">
<meta property="og:site_name" content="Xuren&#39;s Blogs">
<meta property="og:description" content="Spring框架概览​    Spring让创建Java企业级应用变得更简单.它提供了任何你在企业级环境中使用Java进行开发所需要的东西。同时也支持其他能在JVM上运行的语言，例如Groovy和Kotlin。通知也可很灵活创建任何需求所需要的架构。对于Spring框架5.1来说，SPring需要JDK8及其以上的支持，同时也提供对JDK11的开箱即用的长期支持。 ​    Spring支持很多种">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-07-18T08:32:25.998Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Spring框架概览">
<meta name="twitter:description" content="Spring框架概览​    Spring让创建Java企业级应用变得更简单.它提供了任何你在企业级环境中使用Java进行开发所需要的东西。同时也支持其他能在JVM上运行的语言，例如Groovy和Kotlin。通知也可很灵活创建任何需求所需要的架构。对于Spring框架5.1来说，SPring需要JDK8及其以上的支持，同时也提供对JDK11的开箱即用的长期支持。 ​    Spring支持很多种">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"hide","offset":12,"b2t":true,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://xuren.tech/2019/07/18/Spring框架概览/">



  <script>
  (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/099563b3.js","daovoice")
  daovoice('init', {
      app_id: "099563b3"
    });
  daovoice('update');
  </script>





  <title>Spring框架概览 | Xuren's Blogs</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Xuren's Blogs</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://xuren.tech/2019/07/18/Spring框架概览/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Xuren">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/freedom.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Xuren's Blogs">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Spring框架概览</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-07-18T14:34:06+08:00">
                2019-07-18
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Spring/" itemprop="url" rel="index">
                    <span itemprop="name">Spring</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-file-o"></i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>
            </span>
          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  1.7k
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  6
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="Spring框架概览"><a href="#Spring框架概览" class="headerlink" title="Spring框架概览"></a>Spring框架概览</h1><p>​    Spring让创建Java企业级应用变得更简单.它提供了任何你在企业级环境中使用Java进行开发所需要的东西。同时也支持其他能在JVM上运行的语言，例如Groovy和Kotlin。通知也可很灵活创建任何需求所需要的架构。对于Spring框架5.1来说，SPring需要JDK8及其以上的支持，同时也提供对JDK11的开箱即用的长期支持。</p>
<p>​    Spring支持很多种应用类型场景。在一个大企业里面，应用通常会存在很长一段时间，这些应用必须运行在JDK以及应用服务器上，他们的更新周期可能会脱离开发者的控制。其他的可能是以一个单独 jar包在内置的服务器上，也可能是在云端运行。现今仍然有许多应用是独立应用，比如批处理等，这些应用不需要运行在服务器上。</p>
<h2 id="1-Spring对我们来说意味着什么？"><a href="#1-Spring对我们来说意味着什么？" class="headerlink" title="1.Spring对我们来说意味着什么？"></a>1.Spring对我们来说意味着什么？</h2><p>​    专业术语“Spring”在不同的环境下有不同的意义。它可以被用来指定Spring框架本身，这也是它最开的意义。随着时间过去，其他的Spring项目在Spring框架的基础上建立起来。本参考文档聚焦于基础：即Spring框架本身。</p>
<p>​    Spring框架被拆分为了许多模块。应用可以自主选择它需要的模块。Spring的核心模块为  <strong><em>核心容器(core container)</em></strong>,包括 配置模块 和 依赖注入机制。除此之外，Spring对不同的应用架构提供了许多基础支持，包括 消息，事务数据和持久化 以及web。同时它也包含基于Servlet的<strong><em>SpringMVC</em></strong> web框架，也有平行的 <strong><em>Spring WebFlux</em></strong>反应式的web框架。</p>
<p>​    (还有一段，用到了JDK9的新概念，暂时不知道是在说啥，有机会再补翻译)</p>
<h2 id="2-Spring与一系列Spring相关框架的历史"><a href="#2-Spring与一系列Spring相关框架的历史" class="headerlink" title="2.Spring与一系列Spring相关框架的历史"></a>2.Spring与一系列Spring相关框架的历史</h2><p>​    Spring在2003年被提出，作为对早期J2EE规范中的复杂性的响应。虽然有些人认为Java EE和Spring是竞争对手，但Spring实际上是Java EE的补充。Spring编程模型不包含Java EE平台规范;相反，它集成了从EE体系中精心选择的各个规范：</p>
<ul>
<li>Servlet API (<a href="https://jcp.org/en/jsr/detail?id=340" target="_blank" rel="noopener">JSR 340</a>)</li>
<li>WebSocket API (<a href="https://www.jcp.org/en/jsr/detail?id=356" target="_blank" rel="noopener">JSR 356</a>)</li>
<li>Concurrency Utilities (<a href="https://www.jcp.org/en/jsr/detail?id=236" target="_blank" rel="noopener">JSR 236</a>)</li>
<li>JSON Binding API (<a href="https://jcp.org/en/jsr/detail?id=367" target="_blank" rel="noopener">JSR 367</a>)</li>
<li>Bean Validation (<a href="https://jcp.org/en/jsr/detail?id=303" target="_blank" rel="noopener">JSR 303</a>)</li>
<li>JPA (<a href="https://jcp.org/en/jsr/detail?id=338" target="_blank" rel="noopener">JSR 338</a>)</li>
<li>JMS (<a href="https://jcp.org/en/jsr/detail?id=914" target="_blank" rel="noopener">JSR 914</a>)</li>
<li>必要的，也支持 协调事务的JTA/JCA设置</li>
</ul>
<p>Spring框架同时也支持DI(<a href="https://www.jcp.org/en/jsr/detail?id=330" target="_blank" rel="noopener">JSR 330</a>),常用注解(<a href="https://jcp.org/en/jsr/detail?id=250" target="_blank" rel="noopener">JSR 250</a>)规范。开发者可选择使用上述的而非Spring框架提供的Spring特定机制。</p>
<p>​    对于Spring5.0来说，Spring要求至少JavaEE7(Servlet3.1以上，JPA2.1以上)。同时提供开箱即用的集成了更新的API，在Java EE 8(Servlet 4.0, JSON绑定API)运行环境中。这使得Spring与Tomcat 8和Tomcat 9、WebSphere 9和JBoss EAP 7完全兼容。</p>
<p>​    随着时间的推移，Java EE在应用程序开发中的角色已经发生了变化。在Java EE和Spring的早期，创建应用程序是为了部署到应用服务器。今天，在Spring Boot的帮助下，应用程序以一种devops和云友好的方式创建，在内嵌的Servlet容器，并且改动也很少。从Spring Framework 5开始，WebFlux应用程序甚至不直接使用Servlet API，并且可以运行在非Servlet容器的服务器上(比如Netty)。</p>
<p>​    Spring仍让在继续改进与创新。除了Spring框架之外，还有其他项目，比如Spring Boot、Spring Security、Spring Data、Spring Cloud、Spring Batch等等。重要的是，每个项目都有自己的源代码存储库、问题跟踪和发布节奏。可在Spring.io上查看Spring项目的完整列表</p>
<h2 id="3-Spring的设计思想"><a href="#3-Spring的设计思想" class="headerlink" title="3.Spring的设计思想"></a>3.Spring的设计思想</h2><p>​    当你学习一个框架时，重要的是不仅要知道它做什么，还要知道它遵循什么原则。以下是Spring框架的指导原则:</p>
<ul>
<li>在项目应用开发的每个层次上都提供选择。Spring允许你尽可能推迟设计决策。例如，您可以通过配置切换持久性提供者，而无需更改代码。对于许多其他基础设施问题以及与第三方api的集成也是如此。</li>
<li>容纳不同的观点。Spring信奉灵活，并且不对事情应该怎样做发表人任何意见。它在各种不同的层面上支持各种不同的应用</li>
<li>保持强大的向后兼容性。Spring的发展已经被精心的规划管理，以在版本之间强制进行很少的破坏性更改。Spring支持精心选择的JDK版本和第三方库，以方便维护依赖于Spring的应用程序和库。</li>
<li>关心API设计。Spring团队投入了大量的想法和时间来使api更加直观，并将该观点保持在许多本版上。</li>
<li>为代码质量设定高标准。Spring框架非常强调有意义的、及时的和准确的java参考文档。它是极少数可以声明代码结构干净且包之间没有循环依赖关系的项目之一。</li>
</ul>
<h2 id="4-反馈与贡献"><a href="#4-反馈与贡献" class="headerlink" title="4.反馈与贡献"></a>4.反馈与贡献</h2><p>​    对于怎样做之类的问题(<a href="https://spring.io/questions" target="_blank" rel="noopener">questions page</a> )、诊断或调试问题，我们建议使用StackOverflow，并且我们有一个问题页面，列出了说明建议怎样使用。如果你非常确定Spring框架中存在问题，或者想建议一个特性，请使用<a href="https://github.com/spring-projects/spring-framework/issues" target="_blank" rel="noopener">GitHub Issues</a>。</p>
<p>​    如果您心中有一个解决方案或建议的修复，您可以在 <a href="https://github.com/spring-projects/spring-framework" target="_blank" rel="noopener">Github</a>上提交一个pull request。但是，请记住，除了琐碎的问题外，我们希望在问题跟踪器中归档，您可以在那里进行讨论，并留下记录供将来参考。</p>
<p>​    更多详细信息，请参阅在 <a href="https://github.com/spring-projects/spring-framework/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener">CONTRIBUTING</a>中提供的指导方针。</p>
<h2 id="5-快速开始"><a href="#5-快速开始" class="headerlink" title="5.快速开始"></a>5.快速开始</h2><p>​    如果你刚刚开始使用Spring，你可以通过创建一个基于<a href="https://projects.spring.io/spring-boot/" target="_blank" rel="noopener">Spring Boot</a>的应用程序来开始使用Spring框架。Spring Boot提供了一种快速的方法来创建基于Spring的可生产应用程序。它基于Spring框架，支持约定而不是配置，旨在让您尽可能快地启动和运行应用。</p>
<p>​    您可以使用<a href="https://start.spring.io/" target="_blank" rel="noopener">start.spring.io</a>生成一个基本项目或遵循 <a href="https://spring.io/guides" target="_blank" rel="noopener">“快速开始” </a><a href="https://spring.io/guides" target="_blank" rel="noopener">指南</a>中任意项目，例如 <a href="https://spring.io/guides/gs/rest-service/" target="_blank" rel="noopener">开始构建RESTful Web服务</a>。这些指南不仅更容易理解，而且更专注于任务，其中大多数都是基于Spring Boot的。它们还涵盖了Spring 文件夹中的其他项目，你在解决特定问题时可能需要用到这些项目。</p>

      
    </div>
	<div><div>

    <br>
    <br>
    <div style="text-align:left;color: #ccc;font-size:14px;">
	---本文结束<i class="fa fa-paw"></i>感谢您的阅读---
	<br>
	作者：Xuren
	<br>
	<span>发布时间:</span>2019年07月18日 - 14:34:06
	<br>
	<span>最后更新:</span>2019年07月18日 - 16:32:25
	<br>
	本文链接：<a href="/2019/07/18/Spring框架概览/" title="Spring框架概览">http://xuren.tech/2019/07/18/Spring框架概览/</a>
    <br>
	<!--<span class="copy-path"  title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="http://xuren.tech/2019/07/18/Spring框架概览/"  aria-label="复制成功！"></i></span>
    -->
	版权声明：本文为博主原创文章，转载请附上博文链接！
	</div>
	
	<script> 
    var clipboard = new Clipboard('.fa-clipboard');
    clipboard.on('success', $(function(){
      $(".fa-clipboard").click(function(){
        swal({   
          title: "",   
          text: '复制成功',   
          html: false,
          timer: 500,   
          showConfirmButton: false
        });
      });
    }));  
    </script>

</div>
</div>

    
    
    
	<!-- 新加代码 -->
	<div>
    
        

    
    </div>

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Spring官方文档学习-基于5-1/" rel="tag"><i class="fa fa-tag"></i> Spring官方文档学习-基于5.1</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/07/18/Spring核心技术/" rel="prev" title="Spring核心技术">
                Spring核心技术 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        
  <script>
    window._bd_share_config = {
      "common": {
        "bdText": "",
        "bdMini": "1",
        "bdMiniList": false,
        "bdPic": ""
      },
      "image": {
        "viewList": ["tsina", "douban", "sqq", "qzone", "weixin", "twi", "fbook"],
        "viewText": "分享到：",
        "viewSize": "16"
      },
      "slide": {
        "bdImg": "5",
        "bdPos": "left",
        "bdTop": "100"
      }
    }
  </script>

<script>
  with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)];
</script>
<!--//bdimg.share.baidu.com-->

      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC80NDQ3MS8yMTAwMw"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/freedom.png" alt="Xuren">
            
              <p class="site-author-name" itemprop="name">Xuren</p>
              <p class="site-description motion-element" itemprop="description">做一条最咸的咸鱼!</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">38</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">13</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">15</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/xuren11" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:296685262@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Spring框架概览"><span class="nav-number">1.</span> <span class="nav-text">Spring框架概览</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-Spring对我们来说意味着什么？"><span class="nav-number">1.1.</span> <span class="nav-text">1.Spring对我们来说意味着什么？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-Spring与一系列Spring相关框架的历史"><span class="nav-number">1.2.</span> <span class="nav-text">2.Spring与一系列Spring相关框架的历史</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-Spring的设计思想"><span class="nav-number">1.3.</span> <span class="nav-text">3.Spring的设计思想</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-反馈与贡献"><span class="nav-number">1.4.</span> <span class="nav-text">4.反馈与贡献</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-快速开始"><span class="nav-number">1.5.</span> <span class="nav-text">5.快速开始</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Xuren</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">Site words total count&#58;</span>
    
    <span title="Site words total count">63.2k</span>
  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>








        
<div class="busuanzi-count">
<!--  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
-->
  <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>








        
      </div>
    </footer>

    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  




  
  









  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/three/three.min.js"></script>
  

  
  
    <script type="text/javascript" src="/lib/three/three-waves.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  












  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  
  


  

  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
<script type="text/javascript" src="/js/src/clicklove.js"></script>

